﻿Imports DTO
Imports DAO

Public Class HangVe
	Private daohangve As New DAO.HangVe

    Public Function lay_dataset() As DataSet
        Dim dao_hang_ve As New DAO.HangVe
        Return dao_hang_ve.lay_dataset
    End Function


    Public Function Insert(ByVal dtohangve As DTO.HangVe) As Integer
        Return daohangve.Insert(dtohangve)
    End Function

    Public Function save(ByVal dtohangve As DTO.HangVe) As Integer
        If IsNothing(dtohangve.id) Then
            Return Insert(dtohangve)
        Else
            Return Nothing
        End If
    End Function

    Public Function chek(ByVal tenhv As String) As Boolean
        Dim x As Integer = daohangve.chek(tenhv).Tables(0).Rows.Count
        If x = 0 Then
            Return True
        End If
        Return False
    End Function
End Class
